package com.nai365.nart.search.controller;

import com.nai365.nart.common.security.annotation.Inner;
import com.nai365.nart.search.service.ProductSaveService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description:
 * @Created: with IntelliJ IDEA.
 * @author: baogs
 * @createTime: 2021-03-06 16:48
 **/


@Slf4j
@RequestMapping(value = "/search_update")
@RestController
public class ElasticUpdateController {

    @Autowired
    private ProductSaveService productSaveService;


	/**
	 * @function 根据spuId删除商品
	 * @author baogs
	 * @date 2021/6/26 9:35
	 */
	@GetMapping("/down")
	@Inner
	public Long down(@RequestParam("spuId")Long spuId){

		return productSaveService.downProduct(spuId);
	}
	/**
	 * @function 根据skuId删除商品
	 * @author baogs
	 * @date 2021/6/26 9:35
	 */
	@GetMapping("/down_sku")
	@Inner
	public Long downSku(@RequestParam("skuId")Long skuId){

		return productSaveService.downSku(skuId);
	}





}
